#define _CRT_SECURE_NO_WARNINGS
#include "sigle_op.h"
#include "util.h"
#include <string.h>

SingleOp::SingleOp()
{
    int num1, num2;
    char op;
    op = randBetween(0, 1) ? '+' : '-';
    if (op == '+') {
        num1 = randBetween(0, BOUND);
        num2 = randBetween(0, BOUND);
        stdAns = num1 + num2;
    } else {
        num1 = randBetween(0, BOUND);
        num2 = randBetween(0, num1);
        stdAns = num1 - num2;
    }
    sprintf(expr, "%d %c %d", num1, op, num2);
}